package com.likersai.opon.pojo.vo.req.menu;

import com.likersai.opon.pojo.entity.Menu;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;


/**
 * 新增菜单请求
 *
 * @author sun.ye
 * @since 2022-05-31 10:14
 */
@Data
@ApiModel(value="新增菜单请求参数",description="新增菜单请求参数" )
public class AddMenuReq {
    
    @ApiModelProperty(value = "菜单名称",example = "测试菜单")
    private String menuName;
    
    @ApiModelProperty(value = "菜单编码",example = "menu_code")
    private String menuCode;
    
    @ApiModelProperty(value = "菜单标题",example = "测试菜单Title")
    private String menuTitle;

    @ApiModelProperty(value = "父菜单ID",example = "1")
    private Long parentId;

    @ApiModelProperty(value = "路由位置",example = "/test")
    private String router;

    @ApiModelProperty(value = "文件位置",example = "/test/test")
    private String filePath;

    @ApiModelProperty(value = "图标",example = "likersai")
    private String icon;

    @ApiModelProperty(value = "排序",example = "likersai")
    private Integer sort;

    @ApiModelProperty(value = "展示类型",example = "SYN")
    private String type;
    
    public Menu toEntity () {
        Menu menu = new Menu();
        menu.setMenuName(this.getMenuName());
        menu.setMenuCode(this.getMenuCode());
        menu.setMenuTitle(this.getMenuTitle());
        menu.setParentId(this.getParentId());
        menu.setRouter(this.getRouter());
        menu.setFilePath(this.getFilePath());
        menu.setIcon(this.getIcon());
        menu.setSort(this.getSort());
        menu.setType(this.getType());
        return menu;
    }
    
}